<script lang="ts" setup>
    import { userChannel } from '@/stores/userChannel'

    const userCha = userChannel()
    userCha.GetChannelList()
    // 高亮的点击事件
    // 同时发送获取新闻列表的请求
    const ActiveItem = (id:number) => {
        userCha.flag = id
        userCha.GetChannel_New_list(id, Date.now())
    }
</script>
<template>
    <ul class="catagtory">
        <li 
        v-for="item in userCha.ChannelList" 
        :class="{select: userCha.flag === item.id}" 
        :key="item.id"
        @click="ActiveItem(item.id)"
        >{{ item.name }}</li>
    </ul>
</template>
<style scoed lang="less"></style>
    